package ink.lovejinhu.leetcodeMatch;

/**
 * @Author: jin
 * @Date: 2021/9/5 10:34
 * @Version: V1.0
 * @Slogan: Great people are not born great, but show their greatness in the process of growing up
 **/
public class Solution_5863 {
    /**
     * 统计特殊的四元组
     *
     * @param nums
     * @return
     */
    public int countQuadruplets(int[] nums) {
        int res = 0;
        for (int i = 0; i < nums.length; i++) {
            for (int j = i + 1; j < nums.length; j++) {
                for (int k = j + 1; k < nums.length; k++) {
                    for (int l = k + 1; l < nums.length; l++) {
                        if (nums[i] + nums[j] + nums[k] == nums[l]) {
                            res++;
                        }

                    }
                }

            }

        }
        return res;

    }
}
